
/*
 * @Description: 
 * @Author: rendc
 * @Date: 2024-10-14 14:45:22
 * @LastEditors: rendc
 * @LastEditTime: 2024-10-14 15:08:20
 */
/**
 * Test02
 */
import java.io.FileInputStream;
import java.io.IOException;
import java.io.InputStream;
import java.io.OutputStream;

public class Test02 {

  public static void main(String[] args) throws IOException {
    // 1. 声明流
    // 文件输入流 用于从文件中读取字节数据 FileInputStream
    // FileInputStream(path)
    // 2. 创建流
    InputStream inputStream = new FileInputStream("/Users/cc/Desktop/Java/day32/test.txt");
    System.out.println("InputStream: " + inputStream);
    // 3. 使用流
    int r = inputStream.read();
    System.out.println("r: " + r);
    r = inputStream.read();
    System.out.println("r: " + r);
    r = inputStream.read();
    System.out.println("r: " + r);
    r = inputStream.read();
    System.out.println("r: " + r);
    r = inputStream.read();
    System.out.println("r: " + r);

    // 4. 关闭流
    inputStream.close();

  }
}